<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', function () {
    return redirect('/home/index/index');
});
//添加用户
Route::get('/admin/user/add', 'Admin\UserController@add');
Route::post('/admin/user/insert', 'Admin\UserController@insert');
Route::get('/admin/user/index', 'Admin\UserController@index');
Route::post('/admin/user/ajaxStatus', 'Admin\UserController@ajaxStatus');
Route::get('/admin/user/edit/{id}', 'Admin\UserController@edit');
Route::post('/admin/user/update', 'Admin\UserController@update');
Route::get ('/admin/user/delete/{id}', 'Admin\UserController@delete');

//登录


Route::get ('/admin/login', 'Admin\LoginController@login');
Route::post('/admin/dologin', 'Admin\LoginController@dologin');
Route::get('/admin/index/index', 'Admin\LoginController@index');
//验证码
Route::get ('/admin/captcha/{tmp}', 'CodeController@captcha');



//商品分区主页
Route::get('/admin/plate/index', 'Admin\PlateController@index');
//添加商品分区
Route::get('/admin/plate/plateAdd', 'Admin\PlateController@plateAdd');
Route::post('/admin/plate/plateDoAdd', 'Admin\PlateController@plateDoAdd');
//商品分区编辑
Route::get('/admin/plate/plateEdit/{id}', 'Admin\PlateController@plateEdit');
Route::post('/admin/plate/plateDoEdit', 'Admin\PlateController@plateDoEdit');
//商品分区删除
Route::get('/admin/plate/plateDoDelete/{id}', 'Admin\PlateController@plateDoDelete');
//商品查询
Route::get('/admin/plate/searchGoods', 'Admin\PlateController@goodsSearch');
//商品信息预览操作
Route::get('/admin/goods/goodsIndex/{id}', 'Admin\GoodsController@index');
Route::post('/admin/goods/saleEdit/', 'Admin\GoodsController@saleEdit');
Route::post('/admin/goods/hotEdit/', 'Admin\GoodsController@hotEdit');
Route::get('/admin/goods/plateDoDelete/{id}', 'Admin\GoodsController@plateDoDelete');
//前台主页，展示主页商品
Route::get('/home/index/index', 'Home\HomeController@index');
Route::post('/home/index/search', 'Home\HomeController@search');
//展示品牌区商品
Route::get('/home/plate/smallPlate/{id}', 'Home\HomeController@smallPlate');
//展示新上市商品
Route::get('/home/plate/menuplate/{id}', 'Home\HomeController@menuplate');





//退出
Route::get('/admin/logout', 'Admin\LoginController@logout');

//找回密码
Route::get('/admin/forget', 'Admin\ForgetController@forget');

Route::post('/admin/forget/sendEmail', 'Admin\ForgetController@sendEmail');

//网站配置
Route::get('/admin/config/config', 'Admin\ForgetController@config');
Route::post('/admin/config/doconfig', 'Admin\ForgetController@doconfig');





//前台注册

Route::get('home/register/', 'Home\registerController@index');


Route::post('home/doRegister','Home\registerController@doRegister');


//前台登陆
Route::get('home/enter','Home\enterController@enter');
Route::post('home/doenter','Home\enterController@doenter');

//个人中心

Route::get('home/num/num','Home\enterController@num');
Route::get('home/num/donum','Home\enterController@donum');




















//商品添加编辑
Route::get('/admin/goods/goodsDetail/{id}', 'Admin\GoodsController@goodsDetail');
Route::get('/admin/goods/goodsAdd/{id}', 'Admin\GoodsController@goodsAdd');
Route::post('/admin/goods/insert', 'Admin\GoodsController@insert');
Route::get('/admin/goods/goodsEdit/{id}', 'Admin\GoodsController@goodsEdit');
Route::post('/admin/goods/goodsUpdate', 'Admin\GoodsController@goodsUpdate');
Route::get('/admin/goods/goodsDelete/{id}', 'Admin\GoodsController@goodsDelete');
//订单页
Route::get('/admin/indent/index', "Admin\IndentController@index");
Route::get('/admin/indent/sendEdit/{id}', "Admin\IndentController@sendEdit");
Route::get('/admin/indent/is_pay', "Admin\IndentController@is_pay");
Route::get('/admin/indent/is_send', "Admin\IndentController@is_send");
Route::get('/admin/indent/is_receive', "Admin\IndentController@is_receive");
Route::get('/admin/indent/is_comment', "Admin\IndentController@is_comment");
Route::get('/admin/indent/finsh', "Admin\IndentController@finsh");


//前台未登录时页面
//前台商品详情
Route::get('/home/goods/goodsDetail/{id}',"Home\GoodsController@goodsDetail");


//前台登录
Route::get('/home/login/login',"Home\LoginController@login");

//退出登录
Route::get('/home/login/logout',"Home\LoginController@logout");

//验证码
Route::get('/home/captcha/{tmp}',"CodeController@captcha");
Route::post('/home/login/dologin',"Home\LoginController@dologin");

//前台登录后的路由群组
Route::group(['middleware' => 'login'], function(){
    //前台登录后首页
    Route::get('/home/index/indexed',"Home\LoginController@indexed");
    //前台个人中心
    Route::get('/home/user/person',"Home\UserController@person");
    //订单确认
    Route::post('/home/indent/confirm','Home\IndentController@confirm');
    //订单确认选择收货地址
    Route::get('/home/indent/address/{id}','Home\IndentController@address');
    //提交订单
    Route::get('/home/indent/doindent','Home\IndentController@doindent');
    //订单列表
    Route::get('/home/indent/index','Home\IndentController@index');
    //待支付订单
    Route::get('/home/indent/is_pay','Home\IndentController@is_pay');
    //待发货订单
    Route::get('/home/indent/is_send','Home\IndentController@is_send');
    //待收货订单
    Route::get('/home/indent/is_receive','Home\IndentController@is_receive');
    //待评价订单
    Route::get('/home/indent/is_comment','Home\IndentController@is_comment');
    //修改订单
    Route::get('/home/indent/edit/{id}',"Home\IndentController@edit");
    //支付页面
    Route::get('/home/indent/pay/{id}','Home\IndentController@pay');
    Route::get('/home/indent/dopay/{id}','Home\IndentController@dopay');
    //取消订单
    Route::get('/home/indent/cancel/{id}','Home\IndentController@cancel');
    //收货地址
    Route::get('/home/address/index',"Home\AddressController@index");
    //添加地址
    Route::post('/home/address/insert',"Home\AddressController@insert");
    //设置默认地址
    Route::get('/home/address/selected/{id}',"Home\AddressController@selected");
    //删除地址
    Route::get('/home/address/delete/{id}',"Home\AddressController@delete");
    //修改地址
    Route::get('/home/address/edit/{id}',"Home\AddressController@edit");
    //执行修改地址
    Route::post('/home/address/update',"Home\AddressController@update");
    //购物车登陆
    Route::post('/home/shopcar/shopcar','Home\ShopCarController@shopcar');
    //购物车首页
    Route::get('/home/shopcar/index/', 'Home\ShopCarController@index');

    Route::get('/home/shopcar/doEdit', 'Home\ShopCarController@doEdit');

    Route::get('/home/shopcar/delete/{id}', 'Home\ShopCarController@delete');
});

//前台登录
Route::get('/home/login/login',"Home\LoginController@login");


